<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			function f() {
				var a = 10;
				return function g() {
					var b = a + 1;
					return b;
				}
			}

			var g = f();
			console.log(g)
			g(); // returns 11;
			console.log(g());
		</script>
	</body>
    
    <!--<script type="text/javascript">
    	function* fibs(){
    		let a = 0;
    		let b = 1;
    		while(true){
    			yield a;
    			[a, b] = [b, a + b];
    			console.log([a, b]);
    		}
    	}
    	let [first, second, third, fourth, fifth, sixth] = fibs();
    	console.log([first, second, third, fourth, fifth, sixth]);
    </script>-->
</html>